package org.aepscolombia.platform.models.entity;
// Generated Jan 13, 2014 2:36:33 PM by Hibernate Tools 3.2.1.GA


import java.util.HashSet;
import java.util.Set;
import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import static javax.persistence.GenerationType.IDENTITY;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.OneToMany;
import javax.persistence.Table;

/**
 * Production generated by hbm2java
 */
@Entity
@Table(name="production"
    ,catalog="madr_bd10"
)
public class Production  implements java.io.Serializable {


     private Integer idProd;
     private ResultingProducts resultingProducts;
     private Harvests harvests;
     private int productionProd;
     private double yieldProd;
     private Boolean storageProd;
     private Double productionPerPlantProd;
     private Set qualities = new HashSet(0);

    public Production() {
    }

	
    public Production(Harvests harvests, int productionProd, double yieldProd) {
        this.harvests = harvests;
        this.productionProd = productionProd;
        this.yieldProd = yieldProd;
    }
    public Production(ResultingProducts resultingProducts, Harvests harvests, int productionProd, double yieldProd, Boolean storageProd, Double productionPerPlantProd, Set qualities) {
       this.resultingProducts = resultingProducts;
       this.harvests = harvests;
       this.productionProd = productionProd;
       this.yieldProd = yieldProd;
       this.storageProd = storageProd;
       this.productionPerPlantProd = productionPerPlantProd;
       this.qualities = qualities;
    }
   
     @Id @GeneratedValue(strategy=IDENTITY)
    
    @Column(name="id_prod", unique=true, nullable=false)
    public Integer getIdProd() {
        return this.idProd;
    }
    
    public void setIdProd(Integer idProd) {
        this.idProd = idProd;
    }
@ManyToOne(fetch=FetchType.LAZY)
    @JoinColumn(name="expected_product_type_prod")
    public ResultingProducts getResultingProducts() {
        return this.resultingProducts;
    }
    
    public void setResultingProducts(ResultingProducts resultingProducts) {
        this.resultingProducts = resultingProducts;
    }
@ManyToOne(fetch=FetchType.LAZY)
    @JoinColumn(name="id_harvest_prod", nullable=false)
    public Harvests getHarvests() {
        return this.harvests;
    }
    
    public void setHarvests(Harvests harvests) {
        this.harvests = harvests;
    }
    
    @Column(name="production_prod", nullable=false)
    public int getProductionProd() {
        return this.productionProd;
    }
    
    public void setProductionProd(int productionProd) {
        this.productionProd = productionProd;
    }
    
    @Column(name="yield_prod", nullable=false, precision=22, scale=0)
    public double getYieldProd() {
        return this.yieldProd;
    }
    
    public void setYieldProd(double yieldProd) {
        this.yieldProd = yieldProd;
    }
    
    @Column(name="storage_prod")
    public Boolean getStorageProd() {
        return this.storageProd;
    }
    
    public void setStorageProd(Boolean storageProd) {
        this.storageProd = storageProd;
    }
    
    @Column(name="production_per_plant_prod", precision=22, scale=0)
    public Double getProductionPerPlantProd() {
        return this.productionPerPlantProd;
    }
    
    public void setProductionPerPlantProd(Double productionPerPlantProd) {
        this.productionPerPlantProd = productionPerPlantProd;
    }
@OneToMany(cascade=CascadeType.ALL, fetch=FetchType.LAZY, mappedBy="production")
    public Set getQualities() {
        return this.qualities;
    }
    
    public void setQualities(Set qualities) {
        this.qualities = qualities;
    }




}


